﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hiro.Interfaces;

namespace Hiro
{
    /// <summary>
    /// Represents a service that can be instantiated by a compiled container instance.
    /// </summary>
    public class Service : IService
    {
        /// <summary>
        /// Initializes a new instance of the Service class.
        /// </summary>
        /// <param name="dependency">The dependency that can be instantiated by the activation point.</param>
        /// <param name="activationPoint">The activation point responsible for instantiating the dependency.</param>
        public Service(IDependency dependency, IActivationPoint activationPoint)
        {
            TargetDependency = dependency;
            ActivationPoint = activationPoint;
        }

        /// <summary>
        /// Gets the value indicating the <see cref="IDependency"/> that can be instantiated by
        /// the <see cref="ActivationPoint"/>.
        /// </summary>
        /// <value>An <see cref="IDependency"/> object instance.</value>
        public IDependency TargetDependency
        {
            get; private set;
        }

        /// <summary>
        /// Gets the value indicating the <see cref="IActivationPoint"/> that will be used to
        /// instantiate the <see cref="TargetDependency"/>.
        /// </summary>
        /// <value>An <see cref="IActivationPoint"/> object instance.</value>
        public IActivationPoint ActivationPoint
        {
            get;
            private set;
        }
    }
}
